package com.cskaoyan.bean.chenfeng.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 * @author Chen_Feng
 * @since 2022/06/28 23:36
 */

public class StatUserVo {

    /**
     * columns : ["day","users"]
     * rows : [{"day":"2019-04-20","users":1},{"day":"2022-06-26","users":1},{"day":"2022-06-28","users":3}]
     */
    private List<String> columns = Arrays.asList("day", "users");
    private List<RowsEntity> rows;

    public void setColumns(List<String> columns) {
        this.columns = columns;
    }

    public void setRows(List<RowsEntity> rows) {
        this.rows = rows;
    }

    public List<String> getColumns() {
        return columns;
    }

    public List<RowsEntity> getRows() {
        return rows;
    }

    public static class RowsEntity {
        /**
         * day : 2019-04-20
         * users : 1
         */
        @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
        private Date day;
        private int users;

        public void setDay(Date day) {
            this.day = day;
        }

        public void setUsers(int users) {
            this.users = users;
        }

        public Date getDay() {
            return day;
        }

        public int getUsers() {
            return users;
        }
    }
}
